package csc.fresher.view;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.swing.JOptionPane;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import csc.fresher.entity.Customer;
import csc.fresher.entity.CustomerAccount;
import csc.fresher.entity.SavingAccount;
import csc.fresher.entity.SavingTransactionType;
import csc.fresher.entity.Transaction;
import csc.fresher.entity.TransactionType;
import csc.fresher.service.SavingAccountService;
import csc.fresher.service.SavingTransactionService;
import csc.fresher.service.impl.SavingAccountServiceImpl;

@Component
@Scope("request")
public class SavingTransManagedBean implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Autowired
	SavingAccountService savingAccountService;

	@Autowired
	SavingTransactionService savingTransactionService;

	private String accountNumber;
	private String idCardNumber;
	private String message = "";
	private List<SavingAccount> savingAccounts;
	private Transaction transaction;
	private List<Transaction> transactionList;
	
	public Transaction getTransaction() {
		return transaction;
	}


	public void setTransaction(Transaction transaction) {
		this.transaction = transaction;
	}


	public SavingTransManagedBean() {
		message = "";
	}


	
	public List<SavingAccount> getSavingAccounts() {
		return savingAccounts;
	}

	public void setSavingAccounts(List<SavingAccount> savingAccounts) {
		this.savingAccounts = savingAccounts;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	private List<CustomerAccount> cusAccounts;

	public List<CustomerAccount> getCusAccounts() {
		return cusAccounts;
	}

	public void setCusAccounts(List<CustomerAccount> cusAccounts) {
		this.cusAccounts = cusAccounts;
	}

	public String getAccountNumber() {
		return accountNumber;
	}

	public void setAccountNumber(String accountNumber) {
		this.accountNumber = accountNumber;
	}

	public String getIdCardNumber() {
		return idCardNumber;
	}

	public void setIdCardNumber(String idCardNumber) {
		this.idCardNumber = idCardNumber;
	}

	public void approve() {
		JOptionPane.showMessageDialog(null, "ok!");
	}
	@PostConstruct
	public void init() {
	}
	
	
	public SavingTransactionType[] getTypes() {
	   return SavingTransactionType.values();
	}

}
